/*
* ============================================================================
*  Name     : CV8LogAppUi from V8LogAppUi.h
*  Part of  : v8Log
*  Created  : 2006-4-7 by key
*  Description:
*     Declares UI class for application.
*  Version  :
*  Copyright: http:www.3gv8.com
* ============================================================================
*/

#ifndef V8LOGAPPUI_H
#define V8LOGAPPUI_H

// INCLUDES
#include <eikapp.h>
#include <eikdoc.h>
#include <e32std.h>
#include <coeccntx.h>
#include <aknviewappui.h>
#include <akntabgrp.h>
#include <aknnavide.h>
#include <akntabobserver.h>   //for MAknTabObserver
#include "DatabaseObserver.h"
#include "TLogparse.h"
#include "V8LogStruct.h"


// FORWARD DECLARATIONS
#include <CPbkFieldsInfo.h>
class CLogExEngine;
class CV8LogSumInfoContainer;
class CLogExampleLogDatabaseObserver;
class CLogParse;

class CPbkContactEngine;
class CPbkContactItem;
class CPbkDataSaveAppUi;
class CPbkFieldInfo;
class RPbkViewResourceFile;

// CLASS DECLARATION

/**
* Application UI class.
* Provides support for the following features:
* - EIKON control architecture
* - view architecture
* - status pane
* 
*/
class CV8LogAppUi : public CAknViewAppUi,
					public MAknTabObserver,
					public MDatabaseObserver
    {
    public: // // Constructors and destructor

        /**
        * EPOC default constructor.
        */      
        void ConstructL();

        /**
        * Destructor.
        */      
        ~CV8LogAppUi();
        
	public: // New functions
	
		/**
		* SetTitleL()
		* Sets the title text of the title pane
		* @param aTitle text to set
		*/
		void SetTitleL(const TDesC& aTitle); 

    public: // Functions from base classes
	    void NotifyChangeL();
	    CLogExEngine* Model();
		
		/**
		* From MAknTabObserver.
		* @param aIndex tab index
		*/
	    void TabChangedL(TInt aIndex);

    private:
        // From MEikMenuObserver
        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);

    private:
        /**
        * From CEikAppUi, takes care of command handling.
        * @param aCommand command to be handled
        */
        void HandleCommandL(TInt aCommand);

        /**
        * From CEikAppUi, handles key events.
        * @param aKeyEvent Event to handled.
        * @param aType Type of the key event. 
        * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). 
        */
        virtual TKeyResponse HandleKeyEventL(
            const TKeyEvent& aKeyEvent,TEventCode aType);

    private: //Data
        CAknNavigationControlContainer* iNaviPane;
        CAknTabGroup*                   iTabGroup;
        CAknNavigationDecorator*        iDecoratedTabGroup;

		CLogExEngine* 					iLogEngine;
		CLogExampleLogDatabaseObserver* iLogDatabaseObserver;
	public:
		CLogParse*  iLogParse;

	//////////////////////////////////////////////////////////////////////////
	//     by key
	//////////////////////////////////////////////////////////////////////////
//	private: // data
//		CPbkDataSaveAppUi*				iPbkDataSaveAppUi;
//		CPbkContactEngine*				iPbkContactEngine;
//		RPbkViewResourceFile*			iPbkResourceFile;
//		CArrayPtrFlat<CPbkFieldInfo>*	iFieldInfoArray;
    };

#endif

// End of File
